package cn.anzhiyublog.staranimegallery.service;

import cn.anzhiyublog.staranimegallery.model.domain.Picture;
import cn.anzhiyublog.staranimegallery.model.domain.Space;
import cn.anzhiyublog.staranimegallery.model.domain.User;
import cn.anzhiyublog.staranimegallery.model.dto.space.*;
import cn.anzhiyublog.staranimegallery.model.vo.SpaceOnlyIdAndNameVO;
import cn.anzhiyublog.staranimegallery.model.vo.SpaceVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 空间层接口
 *
 * @author 安知一只鱼
 */
public interface SpaceService extends IService<Space> {
    /**
     * 创建空间
     */
    long createSpace(SpaceCreateRequest spaceCreateRequest, User loginUser);

    /**
     * 删除空间
     */
    void deleteSpace(SpaceDeleteRequest spaceDeleteRequest, User loginUser);

    /**
     * 修改空间（管理员）
     */
    void updateSpace(SpaceUpdateRequest spaceUpdateRequest);

    /**
     * 修改空间（本人）
     */
    void editSpace(SpaceEditRequest spaceEditRequest, User loginUser);

    /**
     * id查询空间
     */
    Space getSpaceById(long spaceID);

    /**
     * 分页查询空间（管理员）
     */
    Page<Space> listSpaceByPage(SpacePageQueryRequest spacePageQueryRequest);

    /**
     * obj => vo
     */
    SpaceVO ObjToVO(Space space);

    /**
     * objs => vos
     */
    List<SpaceVO> ObjToVO(List<Space> spaces);

    /**
     * 获取名下空间
     */
    List<SpaceOnlyIdAndNameVO> listMySpaceOnlyIdAndNameVO(User loginUser);
}
